﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Client.Models
{
    public class WorkLogDtl
    {
        /// <summary>
        /// 
        /// </summary>
        public string? XmCode { get; set; }
        /// <summary>
        /// 
        /// </summary>
        public string? XmName { get; set; }
        /// <summary>
        /// 
        /// </summary>
        public string ?FbfxName { get; set; }
        /// <summary>
        /// 本期结算数量
        /// </summary>
        public string ?CheckNum { get; set; }
        /// <summary>
        /// 实际累积结算数量
        /// </summary>
        public string? LJCheckNum { get; set; }
        /// <summary>
        /// 
        /// </summary>
        public decimal? Qty { get; set; }
        /// <summary>
        /// 施工日志累积结算
        /// </summary>
        public decimal ?SettledQty { get; set; }
        /// <summary>
        /// 
        /// </summary>
        public string ?WorkLogDtlId { get; set; }
        /// <summary>
        /// 剩余施工日志结算数量
        /// </summary>
        public string? ResidueAmount { get; set; }
        /// <summary>
        /// 是否施工日志
        /// </summary>

        private bool IsCash_;

        public bool IsCash
        {
            get {

                return Decimal.Parse(string.IsNullOrWhiteSpace(LJCheckNum)?"0": LJCheckNum) +Decimal.Parse(string.IsNullOrWhiteSpace(CheckNum)?"0": CheckNum) >Qty;
            }
            set { IsCash_ = value; }
        }

        /// <summary>
        /// 是否异常
        /// </summary>
        private bool IsCash1_;

        public bool IsCash1
        {
            get { return SettledQty != Decimal.Parse(string.IsNullOrWhiteSpace(LJCheckNum)?"0": LJCheckNum); }
            set { IsCash1_ = value; }
        }
    }
}
